package com.dao.Impl;

import com.dao.ResourceRoleDao;
import com.entity.ResourceRole;
import com.util.JDBC;

import java.util.List;

/**
 * @author 沐白
 */
public class ResourceRoleDaoImpl implements ResourceRoleDao {
    @Override
    public int insert(ResourceRole resourceRole) {
        return 0;
    }

    @Override
    public int update(ResourceRole resourceRole) {
        return 0;
    }

    @Override
    public int delete(int id) {
        return 0;
    }

    @Override
    public List<ResourceRole> findAll() {
        return null;
    }

    @Override
    public int deleteByRole(int roleId) {
        return JDBC.sqlUpdate("delete from resource_role where role_id=?",roleId);
    }

    @Override
    public int insertByRole(int resid,int rid) {
        return JDBC.sqlInsert("insert into resource_role(resource_id,role_id) values(?,?)",
                resid,rid);
    }
}
